<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The getCurrentPoint purpose</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="cairocontext.getantialias.html">CairoContext::getAntialias</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="cairocontext.getdash.html">CairoContext::getDash</a></div>
 <div class="up"><a href="class.cairocontext.html">CairoContext</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="cairocontext.getcurrentpoint" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">CairoContext::getCurrentPoint</h1>
  <h1 class="refname">cairo_get_current_point</h1>
  <p class="verinfo">(PECL cairo &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">CairoContext::getCurrentPoint</span> -- <span class="refname">cairo_get_current_point</span> &mdash; <span class="dc-title">The getCurrentPoint purpose</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-cairocontext.getcurrentpoint-description">
  <h3 class="title">说明</h3>
  <p class="para">面向对象风格</p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span> <span class="methodname"><strong>CairoContext::getCurrentPoint</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">过程化风格</p>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><strong>cairo_get_current_point</strong></span>
    ( <span class="methodparam"><span class="type"><a href="class.cairocontext.html" class="type CairoContext">CairoContext</a></span> <code class="parameter">$context</code></span>
   )</div>

  <p class="para rdfs-comment">
   Gets the current point of the current path, which is conceptually the final point reached by the path so far.
  </p>
  <p class="para">
   The current point is returned in the user-space coordinate system. If there is no defined current point or if cr is in an error status, x and y will both be set to 0.0. It is possible to check this in advance with <span class="methodname"><a href="cairocontext.hascurrentpoint.html" class="methodname">CairoContext::hasCurrentPoint()</a></span>.
  </p>
  <p class="para">
   Most path construction functions alter the current point. See the following for details on how they affect the current point: <span class="methodname"><a href="cairocontext.newpath.html" class="methodname">CairoContext::newPath()</a></span>, 
   <span class="methodname"><a href="cairocontext.newsubpath.html" class="methodname">CairoContext::newSubPath()</a></span>, <span class="methodname"><a href="cairocontext.appendpath.html" class="methodname">CairoContext::appendPath()</a></span>, <span class="methodname"><a href="cairocontext.closepath.html" class="methodname">CairoContext::closePath()</a></span>, <span class="methodname"><a href="cairocontext.moveto.html" class="methodname">CairoContext::moveTo()</a></span>, 
   <span class="methodname"><a href="cairocontext.lineto.html" class="methodname">CairoContext::lineTo()</a></span>, <span class="methodname"><a href="cairocontext.curveto.html" class="methodname">CairoContext::curveTo()</a></span>, <span class="methodname"><a href="cairocontext.relmoveto.html" class="methodname">CairoContext::relMoveTo()</a></span>, 
   <span class="methodname"><a href="cairocontext.rellineto.html" class="methodname">CairoContext::relLineTo()</a></span>, <span class="methodname"><a href="cairocontext.relcurveto.html" class="methodname">CairoContext::relCurveTo()</a></span>, 
   <span class="methodname"><a href="cairocontext.arc.html" class="methodname">CairoContext::arc()</a></span>, <span class="methodname"><a href="cairocontext.arcnegative.html" class="methodname">CairoContext::arcNegative()</a></span>, <span class="methodname"><a href="cairocontext.rectangle.html" class="methodname">CairoContext::rectangle()</a></span>, 
   <span class="methodname"><a href="cairocontext.textpath.html" class="methodname">CairoContext::textPath()</a></span>, <span class="methodname"><a href="cairocontext.glyphpath.html" class="methodname">CairoContext::glyphPath()</a></span>.
  </p>
  <p class="para">
   Some functions use and alter the current point but do not otherwise change current path: <span class="methodname"><a href="cairocontext.showtext.html" class="methodname">CairoContext::showText()</a></span>.
  </p>
  <p class="para">
   Some functions unset the current path and as a result, current point: <span class="methodname"><a href="cairocontext.fill.html" class="methodname">CairoContext::fill()</a></span>, <span class="methodname"><a href="cairocontext.stroke.html" class="methodname">CairoContext::stroke()</a></span>.
  </p>
  
 </div>

 
 <div class="refsect1 parameters" id="refsect1-cairocontext.getcurrentpoint-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">context</code></em></dt>

     <dd>

      <p class="para">
       A valid <a href="class.cairocontext.html" class="classname">CairoContext</a> object.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-cairocontext.getcurrentpoint-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   An array containing the x (index 0) and y (index 1) coordinates of the current point.
  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-cairocontext.getcurrentpoint-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2816">
    <p><strong>Example #1 面向对象风格</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$s&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">CairoImageSurface</span><span style="color: #007700">(</span><span style="color: #0000BB">CairoFormat</span><span style="color: #007700">::</span><span style="color: #0000BB">ARGB32</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">100</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">100</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$c&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">CairoContext</span><span style="color: #007700">(</span><span style="color: #0000BB">$s</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$c</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">moveTo</span><span style="color: #007700">(</span><span style="color: #0000BB">10</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">10</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$c</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getCurrentPoint</span><span style="color: #007700">());<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程的输出类似于：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
array(2) {
  [0]=&gt;
  float(10)
  [1]=&gt;
  float(10)
}
</pre></div>
    </div>
   </div>
  </p>
  <p class="para">
   <div class="example" id="example-2817">
    <p><strong>Example #2 过程化风格</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$s&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cairo_image_surface_create</span><span style="color: #007700">(</span><span style="color: #0000BB">CAIRO_SURFACE_TYPE_IMAGE</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">100</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">100</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$c&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cairo_create</span><span style="color: #007700">(</span><span style="color: #0000BB">$s</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">cairo_move_to</span><span style="color: #007700">(</span><span style="color: #0000BB">$c</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">10</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">10</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">cairo_get_current_point</span><span style="color: #007700">(</span><span style="color: #0000BB">$c</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程的输出类似于：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
array(2) {
  [0]=&gt;
  float(10)
  [1]=&gt;
  float(10)
}
</pre></div>
    </div>
   </div>
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-cairocontext.getcurrentpoint-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="cairocontext.moveto.html" class="methodname" rel="rdfs-seeAlso">CairoContext::moveTo()</a> - The moveTo purpose</span></li>
    <li class="member"><span class="methodname"><a href="cairocontext.hascurrentpoint.html" class="methodname" rel="rdfs-seeAlso">CairoContext::hasCurrentPoint()</a> - The hasCurrentPoint purpose</span></li>
   </ul>
  </p>
 </div>

 
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="cairocontext.getantialias.html">CairoContext::getAntialias</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="cairocontext.getdash.html">CairoContext::getDash</a></div>
 <div class="up"><a href="class.cairocontext.html">CairoContext</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
